Skip to content

Equilibrium - BUGFIX - Write gse.h5 and gsei.h5 when diagnose_src is set - #522

Open
StuartBenjamin wants to merge 2 commits into
developfrom
bugfix/gse-diagnose-src
Open

StuartBenjamin wants to merge 2 commits into
developfrom
bugfix/gse-diagnose-src

Conversation

@StuartBenjamin

@StuartBenjamin StuartBenjamin commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Release note

  • Audience: developers
  • Numerical impact: none (harness @ dc037fc)
  • Migration: none

equilibrium_gse! crashed with UndefVarError: flux not defined whenever diagnose_src = true, so gse.h5 and gsei.h5 were never written; they now are.

Regression report

regress --cases diiid_n1,solovev_n1 --refs bfc60610e,dc037fcd2 --force (julia 1.11.7, pinned manifest, 2 threads): diiid_n1 53 unchanged, solovev_n1 22 unchanged (diagnose_src is off in every case). Full log: harness.log.

Problem

The gse.h5 and gsei.h5 writers in equilibrium_gse! took the grids from flux.xs / flux.ys, a name carried over from the Fortran flux bicube that does not exist in Julia GPEC. Every run with diagnose_src = true stopped there after writing gsec.h5, so the GSE plots in Analysis.Equilibrium had no gse.h5 to read.

Fix

  • src/Equilibrium/Equilibrium.jl: the three flux.xs / flux.ys references become equil.rzphi_xs (ψ) and equil.rzphi_ys (θ), the grids the GSE computation above already uses.

Tests

New testset "equilibrium_gse! writes gse.h5 with diagnose_src" in test/runtests_equil.jl: it runs EQDSK_COCOS_02 in a temporary directory with diagnose_src = true and checks that gsec.h5, gse.h5 and gsei.h5 are written and that the ψ column of gse.h5 is the equilibrium grid. It fails on develop with the UndefVarError.

Notes for reviewers

  • The gse.h5 layout is unchanged and matches Fortran equil_out_gse (gse_data[:, :, 1] = θ, [:, :, 2] = ψ).
  • Analysis.Equilibrium looks for gse.h5 next to the .h5 output, but the writer puts it next to the equilibrium file. That mismatch is separate and unchanged here.

🤖 Generated with Claude Code

equilibrium_gse! referred to an undefined `flux` for the psi and theta grids,
so diagnose_src = true stopped with an UndefVarError before writing gse.h5 and
gsei.h5. Use equil.rzphi_xs / rzphi_ys. New testset checks the three files and
their grids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the bugfix Something was wrong and now is not label Oct 13, 2026
@StuartBenjamin StuartBenjamin self-assigned this Oct 13, 2026
…ψ column

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Something was wrong and now is not

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant